<%@page import="com.sjyy.accountpatient.model.*" %>

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title>AccountPatient维护</title>
	
	<script src="${ctx}/scripts/rest.js" ></script>
	<link href="<c:url value="/widgets/simpletable/simpletable.css"/>" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>
	
	<script type="text/javascript" >
		$(document).ready(function() {
			window.simpleTable = new SimpleTable('queryForm',${page.thisPageNumber},${page.pageSize},'${pageRequest.sortColumns}');
		});
	</script>
</rapid:override>

<rapid:override name="content">
	<form id="queryForm" name="queryForm" method="get" style="display: inline;">
	<div class="queryPanel">
		<fieldset>
			<table>
				<div class="form-group inline">
					<label>accountId</label>	
					<input placeholder="请输入accountId" value="${query.accountId}" id="accountId" name="accountId" maxlength="10"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>nickname</label>	
					<input placeholder="请输入nickname" value="${query.nickname}" id="nickname" name="nickname" maxlength="32"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>iconUrl</label>	
					<input placeholder="请输入iconUrl" value="${query.iconUrl}" id="iconUrl" name="iconUrl" maxlength="128"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>name</label>	
					<input placeholder="请输入name" value="${query.name}" id="name" name="name" maxlength="32"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>tel</label>	
					<input placeholder="请输入tel" value="${query.tel}" id="tel" name="tel" maxlength="11"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>address</label>	
					<input placeholder="请输入address" value="${query.address}" id="address" name="address" maxlength="256"  class="form-field"/>
					<br/>
				</div>
			</table>
			<button type="button" class="btn btn-default" onclick="getReferenceForm(this).action='${ctx}/accountpatient'">查询</button>
		</fieldset>
		<div class="handleControl">
			<button type="button" class="btn btn-default" onclick="window.location = '${ctx}/accountpatient/new'">新增</button>
			<button type="button" class="btn btn-default" onclick="doRestBatchDelete('${ctx}/accountpatient','items',document.forms.queryForm)">删除</button>
		<div>
	
	</div>
	
	<div class="gridTable">	
		<table width="100%"  border="0" cellspacing="0" class="table text-center">
		  <thead>			  
			  <tr>
				<th style="width:1px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th>
				<th sortColumn="account_id" >accountId</th>
				<th sortColumn="nickname" >nickname</th>
				<th sortColumn="icon_url" >iconUrl</th>
				<th sortColumn="name" >name</th>
				<th sortColumn="tel" >tel</th>
				<th sortColumn="address" >address</th>
				<th style="white-space:nowrap;">操作</th>
			  </tr>			  
		  </thead>
		  <tbody>
		  	  <c:forEach items="${page.result}" var="item" varStatus="status">
			  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
				<td><input type="checkbox" name="items" value="${item.patientId}"></td>
				<td><c:out value='${item.accountId}'/>&nbsp;</td>
				<td><c:out value='${item.nickname}'/>&nbsp;</td>
				<td><c:out value='${item.iconUrl}'/>&nbsp;</td>
				<td><c:out value='${item.name}'/>&nbsp;</td>
				<td><c:out value='${item.tel}'/>&nbsp;</td>
				<td><c:out value='${item.address}'/>&nbsp;</td>
				<td>
					<a href="${ctx}/accountpatient/${item.patientId}">查看</a>&nbsp;&nbsp;
					<a href="${ctx}/accountpatient/${item.patientId}/edit">修改</a>&nbsp;&nbsp;
					<a href="${ctx}/accountpatient/${item.patientId}" onclick="doRestDelete(this,'你确认删除?');return false;">删除</a>
				</td>
			  </tr>
			  
		  	  </c:forEach>
		  </tbody>
		</table>
	
		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>
		
	</div>
	</form>
</rapid:override>
<rapid:override name="script"><script></script></rapid:override>
<%@ include file="base.jsp" %>
